<?php

class ActionActivitySearchForm extends CFormModel
{
	public $conditionVal;
	public $conditionField;
	public $dateFrom;
	public $dateTo;

	/**
	 * Declares the validation rules.
	 */
	public function rules()
	{
		return array(
			array('conditionVal, conditionField, dateFrom, dateTo', 'safe'),
		);
	}

	/**
	 * Declares customized attribute labels.
	 * If not declared here, an attribute would have a label that is
	 * the same as its name with the first letter in upper case.
	 */
	public function attributeLabels()
	{
		return array(
			'conditionVal' => t('info', 'Search For:'),
			'conditionField' => t('info', 'Search Field:'),
			'dateFrom' => t('info', 'Date From:'),
			'dateTo' => t('info', 'Date To:')
		);
	}
	
	public function getFieldLabel($field)
	{
		$labels = $this->attributeLabels();
		
		return empty($labels[$field])? '' : $labels[$field];
	}
	
	public function listConditionFields()
	{
		return array(
			'id_log_action' => t('info', 'Action ID'),
			'action' => t('info', 'Action'),
			'username' => t('info', 'Username')
		);
	}
}